using System.Collections;
using System.Collections.Generic;
public class Buff5 : PlayerControllerBuffBase
{
    private float m_HealthUp = 500f;
    public override string GetDescription()
    {
        return $"生命值上限提高{m_HealthUp}点，\n在你受到伤害后提高生命恢复速度。";
    }
    public override void AfterBeAdded()
    {
        Owner.MaxHealth += m_HealthUp;
        Owner.OnCurrentHealthChange += OnCurrentHealthChangeListener;
    }
    public override void AfterBeRemoved()
    {
        Owner.MaxHealth -= m_HealthUp;
        Owner.OnCurrentHealthChange -= OnCurrentHealthChangeListener;
    }
    private void OnCurrentHealthChangeListener(float change)
    {
        if (change < 0)
        {
            Owner.BuffSystem.AddBuff<Buff4>("圣物之盾", 1);
        }
    }
}